package com.easyshopping.persistence;

import android.content.ContentValues;
import android.database.Cursor;
import android.database.SQLException;

import com.easyshopping.domain.Item;
import com.easyshopping.domain.ItemCategory;
import com.easyshopping.domain.ShoppingList;

public interface IPersistence {

	public IPersistence open() throws SQLException;
	
	public void close();
	
	public void saveShoppingList(ShoppingList sl);
	
	public void saveItem(Item item);
	
	public Cursor fetchAllShoppingLists();
	
	public Cursor fetchPartShoppingLists();
	
	public Cursor fetchAllItemsOfShoppingList(int slID);
	
	public Cursor fetchRestItemsOfShoppingList(int slID);
	
	public Cursor fetchAllItemsOfCategory(int cat_id);
	
	public void updateItemState(int item_id, boolean state);
	
	public void saveItemCategory(ItemCategory category);
	
	public Cursor fetchItemCategories();
	
	public void deleteItemCategory(int itemCate_id);
	
	public void deleteItem(int item_id);
	
	public Cursor fetchItem(int item_id);
	
	public Cursor fetchItemCategory(int itemCategory_id);
	
	public void updateItem(int item_id, ContentValues values);
	
	public void updateItemCategory(int itemCategory_id, ContentValues values);
	
	public void updateShoppinglist(int sl_id, ContentValues values);
	
	public void deleteShoppinglist(int sl_id);
	
	public boolean isShoppinglistFinished(int slID);
	
	public Cursor fetchCurrencies();
	
	public Cursor fetchUnits();
}
